/**
CAlliance: Class holding information for alliances.
**/
#pragma once

#ifndef _CALLIANCE_H_
#define _CALLIANCE_H_

#include <windows.h>
#include "structs.h"
#include <vector>
#include "CParty.h"

class CChar;
class CParty;

//it's assumed here that the alliance leader is the party leader of the lead party. sounds confusing, but it's logical.
class CAlliance {
public:
	CAlliance(void);
	~CAlliance(void);
	CParty * getMainParty();
	int setMainParty(CParty * aLeader);
	int addParty(CParty * party);
	int removeParty(CParty * party);
	int dissolveAlliance(void);
	unsigned int partyCount(void);
	std::vector<CParty*> partyList; //list of parties in alliance

	bool lockAllianceList(void);
	bool unlockAllianceList(void);

private:
	CParty * aLeader;		      		//alliance lead party
	CSemaphore* allianceListSemaphore;  //Locks and unlocks the party list

};
#endif

